import request from '@/utils/request'

const CATEGORY_URL = "/admin/system/sysCategory"

export default {
    //查询全部
    findAll(){
        return request({
            url: `${CATEGORY_URL}/findAllCategory`,
            method: 'get',
        })
    },
    //根据id去查询信息
    findCategoryById(id) {
        return request({
            url: `${CATEGORY_URL}/findById/${id}`,
            method: 'get',
        })
    },
    //添加用户
    addCategory(sysCategory) {
        return request({
            url: `${CATEGORY_URL}/addCategory`,
            method: 'post',
            data: sysCategory
        })
    },
    //修改用户
    updateCategory(sysCategory) {
        return request({
            url: `${CATEGORY_URL}/updateCategory`,
            method: 'post',
            data: sysCategory
        })
    },
    //批量删除
    deleteUserIds(ids) {
        return request({
            url: `${CATEGORY_URL}/deleteIds`,
            method: 'delete',
            data: ids,
        })
    },
    //删除
    deleteById(id) {
        return request({
            url: `${CATEGORY_URL}/deleteById/${id}`,
            method: 'delete',
        })
    },
    // 列表以及分页 
    getPageList(page, limit, searchObj) {
        return request({
            //  url: '/admin/system/role/'+page+"/"+limit,
            url: `${CATEGORY_URL}/${page}/${limit}`,
            method: 'get',
            params: searchObj
        })
    },
}